Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revise ReplicaLeaderCost #1672

Merged
merged 7 commits into from
Apr 30, 2023

Conversation

qoo332001
Copy link
Collaborator

fix #1670
此PR修改計算搬移leader數量的MigrationCost,原本的計算方法為"計算每個broker在搬移前/搬移後的leader數量差異",此PR將migrate in與 migrate out拆開計算,如此一來,計算leader的搬移數量的移入與移出將不會抵銷

舉個例子:
一個broker搬移前有5個replica leader,此時有一個搬移計畫對此broker移入20個replica leader以及移出10個leader,搬移後此broker上會有 5+20-10個leader(15),原來的算方法會看到leader搬移成本為15-5=+10,也就是增加了10個leader,但這不能實際表示搬移計畫移入或是移出多少leader,正確的數量應該分開計算移入20以及移出10,此PR對此做修正

Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qoo332001 qoo332001 merged commit f86391d into opensource4you:main Apr 30, 2023
@qoo332001 qoo332001 deleted the reviseReplicaLeaderCost branch May 26, 2023 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inquiry about the definition of "a movement" for max.migrated.leader.number constraint
2 participants